<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page isELIgnored="false" %>
<!-- <!DOCTYPE html> -->
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    
    <base href="<%=request.getContextPath()%>/">
    <title>登录/注册</title>
    <link rel="stylesheet" href="css/login.css"/>
    
     <script type="text/javascript">
        window.onload=function(){
        var msg= "${msg}";
        if(!(msg==""||msg==null)){
            var pmsg=document.getElementById("pmsg");
            pmsg.innerHTML=msg;
        }
}
     function check() {
			var username=document.getElementById("username");
			var password=document.getElementById("password");
			var password1=document.getElementById("password1");
			var pmsg=document.getElementById("pmsg");
			if(username.value==""||username.value==null){
				pmsg.innerHTML="用户名不能为空";
				return false;
			}
			
			if(password.value==""||password.value==null){
				pmsg.innerHTML="密码不能为空";
				return false;		
			}
			return true;
		}
			
		</script>
</head>
<body>
				
				<div class="title">
					在 线 投 票 系 统
				 </div>
			
			    <div class="container">
			        <div class="container-forms">
			            <div class="container-info">
			                <div class="info-item">

			                </div>
			                <div class="info-item">
			                    <div class="table">
			                        <div class="table-cell">
			                            <p>
			                                没有账号快来注册啊?
			                            </p>
			                            <button class="info-btn">
			                                <a href="admin/reg.jsp" style="text-decoration:none">注册</a>
			                            </button>
			                        </div>
			                    </div>
			                </div>
			            </div>
			            <div class="container-form">
			                <div class="form-item log-in">
			                    <div class="table">
			                        <div class="table-cell">
			                        
			                        	<form action="loginServlet" method="post" onsubmit="return check();" >
				                        	<input id="username" type="text" name="username" placeholder="用户名">
				                            <input id="password" type="password" name="password" placeholder="密码"> 
				                            <input type="submit" value="登录"/>
			                        	</form>
			                        	<div class="test">
			                        		<span id="pmsg"></span>
			                        	</div> 

			                        </div>
			                    </div>
			                </div>
			            </div>
			        </div>
			    </div>
    <script src="js/script.js"></script>
</body>
</html>